<? include("function.php"); ?>

<?

	if($_GET['act'] == "add"){
		
		$valuearray['writter_id'] = "";
		$valuearray['writter_name'] = "Administrator";
		$valuearray['pcomment_des'] = $_GET['des'];
		$valuearray['pcomment_create'] = date('Y-m-d H:i:s');
		$valuearray['pcomment_update'] = date('Y-m-d H:i:s');
		$valuearray['pcomment_status'] = 1;
		$valuearray['post_id'] = $_GET['id'];
		$valuearray['tables'] = $_GET['tables'];
		$valuearray['likes'] = 0;
		$valuearray['view'] = 0;
		$valuearray['pcomment_email'] = $_GET['email'];
		$valuearray['pauthor'] = 1;
		$valuearray['padminfeedback'] = 1;
		(date('a') == "am")? $ampm = 0: $ampm = 1;
		$valuearray['ampm'] = $ampm;
		$valuearray['pcomment_ip'] = $_SERVER['REMOTE_ADDR'];
		
		$valuearray1['padminfeedback'] = 1;
		Qupdate("post_comment","",$valuearray1," pcomment_id = ".$_REQUEST['pcomment_id']);
		
		Qinsert("post_comment","",$valuearray);
		
	}else if($_GET['act'] == "del"){
		mysql_query("DELETE FROM `post_comment` WHERE `post_comment`.`pcomment_id` = ".$_REQUEST['pcomment_id']."  and  `post_comment`.tables = '".$_REQUEST['tables']."' ");
	}
	
?>